package pro.shushi.pamirs.hr.api.model.eam;

import pro.shushi.pamirs.boot.base.ux.annotation.field.UxWidget;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxDetail;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxForm;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxTable;
import pro.shushi.pamirs.hr.api.enums.eam.MtoolPjTypeEnum;
import pro.shushi.pamirs.hr.api.enums.eam.UkCycTypeEnum;
import pro.shushi.pamirs.hr.api.enums.eam.UkMtdEnum;
import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.IdModel;
import pro.shushi.pamirs.meta.enmu.NullableBoolEnum;

import java.math.BigDecimal;
import java.util.List;

// 模型中UX开头的注解(UxForm/UxTable/UxDetail等)可以不用写，都可在设计器中进行可视化配置; 代码里面写这些注解是为了默认页面的交互
@UxForm(grid = 3)
@UxDetail(grid = 3)
@Model.model(EamMtoolMtPj.MODEL_MODEL)
@Model(displayName = "工装保养配置明细表",labelFields = {"pjCode"})
@Model.Advanced(table="eam_mtool_mt_pj",unique = {"orgCode, mmdCode, ukCycType, pjCode"})
public class EamMtoolMtPj extends IdModel {

    public static final String MODEL_MODEL = "hr.simple.eamMtoolMtPj";

    @Field(displayName = "组织编码", invisible = true)
    private String orgCode;

    @Field(displayName = "工装型号编码", invisible = true)
    public String mmdCode;

    @Field.Enum(size='4')
    @Field(displayName = "保养类型", invisible = true)
    public UkCycTypeEnum ukCycType;

//    @UxTableSearch.FieldWidget(@UxWidget())
    @Field(displayName = "项目编码", required = true)
    public String pjCode;

//    @UxTableSearch.FieldWidget(@UxWidget())
    @Field(displayName = "项目名称", required = true)
    public String pjName;

    @Field.Enum(size='4')
    @Field(displayName = "保养项类型", required = true)
    public MtoolPjTypeEnum mtoolPjType;

    @Field.Enum(size='4')
    @Field(displayName = "方法", required = true)
    public UkMtdEnum ukMtd;

    @Field.Text
    @Field(displayName = "标准")
    private String ukStd;

    @Field.Money(M=20,D=6)
    @Field(displayName = "标准耗时(小时)",required = true,defaultValue = "0")
    public BigDecimal sts;

    @UxForm.FieldWidget(@UxWidget(widget = "Upload"))
    @UxTable.FieldWidget(@UxWidget(widget = "Upload"))
    @UxDetail.FieldWidget(@UxWidget(widget = "Upload"))
    @Field.Advanced(columnDefinition = "TEXT")
    @Field(displayName = "附件", serialize = Field.serialize.COMMA,
            store = NullableBoolEnum.TRUE, multi = true)
    private List<String> attachment;

    @Field.Text
    @Field(displayName = "备注")
    private String remark;


}
